from django.db import models
from django.contrib.auth.models import User

# Create your models here.


class Article(models.Model):

    title = models.CharField(max_length=30)
    content = models.TextField()
    author = models.ForeignKey(User, on_delete=models.DO_NOTHING, default=1)
    c_time = models.DateTimeField(auto_now_add=True)
    m_time = models.DateTimeField(auto_now=True)
    is_deleted = models.BooleanField(default=False)

    def __str__(self):
        return '<Article: %s>' % self.title
